package com.axjy.user.controller;

import com.axjy.comm.pojo.TpLinkUser;
import com.axjy.comm.pojo.TpUser;
import com.axjy.comm.vo.Result;
import com.axjy.user.mapper.LinkUserMapper;
import com.axjy.user.service.UserService;
import com.axjy.user.vo.LinkUserVo;
import com.axjy.user.vo.UserVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class UserController {

    @Resource
    private UserService userService;



    @RequestMapping("/p/login")
    public Result login(@RequestBody TpUser tpUser){
      Object[] objs=  userService.login(tpUser.getPhone(),tpUser.getPassword());
        return Result.success(objs);
    }

    @RequestMapping("/v/queryLinkUser")
    public Result queryLinkUser(@RequestBody LinkUserVo linkUserVo){
        List<LinkUserVo> list= userService.queryLinkUser(linkUserVo.getUserId());
        return Result.success(list);
    }

}
